<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @property int $health_id 健康
 * @property int $id
 * @property int $user_id 用户
 * @property string $createtime
 * @property string $name
 * @property-read \app\model\ProjectHealth $health
 * @property-read \app\model\ProjectHealthFoodNutrition $nutrtion
 * @property-read \app\model\ProjectHealthFoodNutrition[] $nutrtions
 * @mixin \think\Model
 */
class ProjectHealthFood extends Model
{
	protected $createTime = 'createtime';
	
	function nutrtions()
	{
		return $this->hasMany(ProjectHealthFoodNutrition::class,'food_id');
	}
	
	function nutrtion()
	{
		return $this->hasOne(ProjectHealthFoodNutrition::class,'food_id');
	}
	
	function health()
	{
		return $this->belongsTo(ProjectHealth::class,'health_id');
	}
	
}
